<?php
function tlp_insert($tlp, $karyID=''){
	$sql = "insert into telpon values ('$tlp', '$karyID')";	
	return mysql_query($sql);
}

function tlp_delete($tlp, $karyID=false){
	$sql = "DELETE FROM telpon 
			WHERE NO_TELPON='$tlpID' ";
	
	if ($karyID){
		$sql .= " AND KODE_KARYAWAN='$karyID'";
	}
	return mysql_query($sql);
}

function tlp_isExistID($tlpID){
	$sql = "select * from telpon where NO_TELPON=$tlpID";
	$res = mysql_query($sql);
	while (mysql_fetch_assoc($res)){ return true; }
	return false;
}

function tlp_load($karyID){
	$sql .= "select * from telpon where KODE_KARYAWAN='$karyID'";
	return mysql_query($sql);
}